package com.feri.fc.admin.controller;

import com.feri.fc.admin.param.PageParam;
import com.feri.fc.admin.param.ServeAdd;
import com.feri.fc.admin.service.HospitalService;
import com.feri.fc.entity.Hospital;
import com.feri.fc.param.HospitalAdd;
import com.feri.fc.vo.PageData;
import com.feri.fc.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/27 13:52
 * @Modified:
 */
@RestController
@RequestMapping("api/hospital")
@Slf4j
public class HospitalController {
    @Resource
    private HospitalService service;


    @PostMapping("add")
    public R add(HospitalAdd add){
        return service.add(add);
    }
    @GetMapping("page")
    public PageData<Hospital> page(PageParam param){
        return service.queryPage(param);
    }

    @GetMapping("all")
    public R all(){
        return service.all();
    }
}
